#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from src.account.account_manager import AccountManager

def create_test_account():
    """创建测试账号"""
    account_manager = AccountManager()
    
    # 创建测试账号
    success, message, account = account_manager.create_account(
        username='test',
        email='test@example.com',
        password='test123'
    )
    
    if success:
        print(f'测试账号创建成功: {account.username}, ID: {account.account_id}')
    else:
        print(f'测试账号创建失败: {message}')
    
    # 检查所有账号
    from database import db_manager
    result = db_manager.execute_query('SELECT id, username, email FROM accounts')
    print('\n所有账号:')
    for r in result:
        print(f'ID: {r["id"]}, 用户名: {r["username"]}, 邮箱: {r["email"]}')

if __name__ == '__main__':
    create_test_account()